/*
 * =====================================================================================
 *
 *       Filename:  readwrite.c
 *
 *    Description:  demo of read and write
 *
 *        Version:  1.0
 *        Created:  04/13/2012 03:08:34 AM
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  Zhiyi Wu (Z.W), zhiyiw@uoregon.edu
 *        Company:  University of Oregon
 *
 * =====================================================================================
 */

#include	"stdio.h"
#include	"unistd.h"
#include	"string.h"
	void
main (  )
{
char cmd[1024];  //command you typed
char feedback[1024]="Hello, this is your input:"; //feedback from user
char welcome[1024]="Please write your words here:";//promopt the input
write(1, welcome, sizeof(welcome));//write welcome to screen

read(0,cmd,1024);//read input from screen

strcat(feedback,cmd);//append your input to feedback

printf("Return value of Write(): %d\n", write(1, feedback, sizeof(feedback)));

return ;
}		/* -----  end of function main  ----- */
